<!--<page-header *ngIf="type == 0" [autoTitle]="false"></page-header>-->
<nz-card [nzBordered]="false">
  <section class="search-section">
    <input nz-input placeholder="下单人" [(ngModel)]="keyword" class="search-item"/>
    <nz-select [(ngModel)]="companyId" [nzPlaceHolder]="'所属活动'" *ngIf="type == 0" class="search-item" style="width: 330px;" [nzAllowClear]="true" [nzShowSearch]="true">
      <nz-option
        *ngFor="let option of companyList"
        [nzLabel]="option.title"
        [nzValue]="option.id">
      </nz-option>
    </nz-select>
    <button nz-button [nzType]="'primary'" nzGhost (click)="search()" class="search-item">
      <i class="anticon anticon-search"></i><span>搜索</span>
    </button>
  </section>
  <nz-table #nzTable [nzData]="page.content"
            [nzPageSize]="page.size"
            [nzTotal]="page.totalElements"
            [nzFrontPagination]="false"
            [(nzPageIndex)]="page.number"
            (nzPageIndexChange)="changePageNo($event)"
            [nzLoading]="isLoading">
    <thead>
    <tr>
      <th>序号</th>
      <th  style="max-width: 200px;">下单人</th>
      <th style="min-width: 120px;">下单人手机号</th>
      <th *ngIf="type != 1" style="max-width: 200px;">收益人</th>
      <th *ngIf="type != 1" style="min-width: 120px;">收益人手机号</th>
      <th *ngIf="type == 0" style="max-width: 380px;">所属活动</th>
      <th>获得时间</th>
      <th>收益金额</th>
      <th>收益比率</th>
      <th>订单总额</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data;let i=index">
      <td>
        {{i+1}}
      </td>
      <td style="max-width: 200px;">{{data.orderCusName}}</td>
      <td  style="min-width: 120px;">{{data.orderCusPhone}}</td>
      <td *ngIf="type != 1" style="max-width: 200px;">{{data.cusName}}</td>
      <td *ngIf="type != 1"  style="min-width: 120px;">{{data.cusPhone}}</td>
      <td *ngIf="type == 0" style="max-width: 380px;">{{data.companyId|dicsNamePipe:companyList:"id":"title"}}</td>
      <td>{{data.saveDate}}</td>
      <td>{{data.profit}}</td>
      <td>{{data.ratio}}</td>
      <td>{{data.moonCakeReservation.goodsTotalPrice}}</td>
      <td>
        <a href="javascript:void (0);" (click)="seeEntity(data)">查看详情</a>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>
